import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import static java.lang.System.*;
public class Main {
	
	
	
	public static void main(String[]agrs)
	{
		Scanner kb = new Scanner(in);
		Grid c1 = new Grid(kb.next());
		
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		List<String> raw = new ArrayList<String>();
		try
		{
		    String s;
		    while((s = in.readLine()) != null) raw.add(s);
		} catch (IOException e)
		{
		    e.printStackTrace();
		}
		Grid grid = new Grid(raw.toArray(new String[0]));
	}
	
	 private Grid Update(char k, Grid oldGrid)
     {
         Grid newGrid = new Grid(oldGrid); //Create new grid

         //Update robot on both grids
         newGrid.moveRobot(k);
         oldGrid.moveRobot(k);

         if (oldGrid.getFloodrate() != 0 && newGrid.getWaterCycle() == oldGrid.getFloodrate())
         {//if floodRate is nonzero and the waterCycle is now equal to the floodrate, Increase water level
             newGrid.setWater(1+newGrid.getWater());
             newGrid.setWaterCycle(0); //Reset WaterCycle
         }
         newGrid.setWaterCycle(1+newGrid.getWaterCycle()); //Increase water cycle

         //Update rocks
         for (int j = oldGrid.getHeight() - 1; j >= 0; j--)
         {
             for (int i = 1; i < oldGrid.getWidth(); i++)
             {
                 if (oldGrid.getBlockObjects().get(i).get(j).getCharacter() == '*')
                 {
                     if (oldGrid.getBlockObjects().get(i).get(j+1).getCharacter() == ' ')
                         newGrid.moveRock(new Point(i, j), new Point(i, j + 1), oldGrid);
                     else if (oldGrid.getBlockObjects().get(i).get(j+1).getCharacter() == '*')
                     {
                         if (oldGrid.getBlockObjects().get(i+1).get(j).getCharacter() == ' ' && oldGrid.getBlockObjects().get(i+1).get(j+1).getCharacter() == ' ')
                             newGrid.moveRock(new Point(i, j), new Point(i + 1, j + 1), oldGrid);
                         else if (oldGrid.getBlockObjects().get(i-1).get(j).getCharacter() == ' ' && oldGrid.getBlockObjects().get(i-1).get(j+1).getCharacter() == ' ')
                             newGrid.moveRock(new Point(i, j), new Point(i - 1, j + 1), oldGrid);
                     }
                     else if (oldGrid.getBlockObjects().get(i).get(j+1).getCharacter() == '\\')
                     {
                         if (oldGrid.getBlockObjects().get(i+1).get(j).getCharacter() == ' ' && oldGrid.getBlockObjects().get(i+1).get(j+1).getCharacter() == ' ')
                             newGrid.moveRock(new Point(i, j), new Point(i + 1, j + 1), oldGrid);
                     }
                 }
             }
         }

         //Check if the robot is underwater
         if (newGrid.getCurrentRobot().getLocation().getY() >= newGrid.getHeight() - newGrid.getWater())
         {
             newGrid.getCurrentRobot().setRobotUnderWaterCounter(newGrid.getCurrentRobot().getRobotUnderWaterCounter()+1); //Increase the water counter
         }
         else
         {
             newGrid.getCurrentRobot().setRobotUnderWaterCounter(0); //Reset counter if dry
         }

         return newGrid;
     }

	 private void filter(List<List<BlockObject>> BlockObjects )
	 {
		 
	 }
}
